<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head>
	<style type="text/css">
		.ui-widget,.ui-widget .ui-widget {
			font-size: 12px !important;
		}
	</style>
</h:head> 
<body> 
	<p:panel header="Kullanici Tanimlama Ekrani">
		<p:messages autoUpdate="true"/>
		<h:form id="kayitForm">
			<h:panelGrid columns="2">
				Ad : <p:inputText value="#{kullaniciBean.kullanici.ad}" id="ad"/>
				Soyad : <p:inputText value="#{kullaniciBean.kullanici.soyad}" id="soyad"/>
				Integer : <p:inputText value="#{kullaniciBean.kullanici.yas}" id="yas"/>
			
				<p:commandButton value="Kaydet" action="#{kullaniciBean.kaydet()}" update="@form :listeForm" rendered="#{kullaniciBean.kullanici.id == null}" id="kaydet"/>
				<p:commandButton value="Düzenle" action="#{kullaniciBean.duzenle()}" update="@form :listeForm" rendered="#{kullaniciBean.kullanici.id != null}" id="duzenle"/>
			</h:panelGrid>
		</h:form>
		
		<h:form id="listeForm">
			<p:dataTable value="#{kullaniciBean.kullaniciListesi}" var="kul" id="liste">
				
				<p:column headerText="Sil">
					<p:commandLink value="Sil" action="#{kullaniciBean.sil(kul)}" update="@form" id="sil"/>
				</p:column>
			
				<p:column headerText="Seç">
					<p:commandLink value="Seç" action="#{kullaniciBean.sec(kul)}" update=":kayitForm"/>
				</p:column>
			
				<p:column headerText="Id">
					#{kul.id}
				</p:column>
			
				<p:column headerText="Ad">
					#{kul.ad}
				</p:column>
			
				<p:column headerText="Soyad">
					#{kul.soyad}
				</p:column>
			
				<p:column headerText="Yas">
					#{kul.yas}
				</p:column>
			
			</p:dataTable>
		
		</h:form>
		
	</p:panel>
</body> 
</html>
